package com.banyuan;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class InputDemo {
    public static void main(String[] args) {
        // 读取文件，展示文件内容
        InputStream is = null;
        try {
            is = new FileInputStream("/Users/edy/Desktop/file/1.txt");
            byte[] bytes = new byte[50];
            int read;
            while ((read = is.read(bytes)) > 0) {
                System.out.println(new String(bytes,0,read));
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUtilis.closeQuiety(is);
        }


    }
}
